---------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix8.3.log
  log type:  text
 opened on:  12 May 2025, 18:15:51

. use "C:\Users\sbstjp\OneDrive - Cardiff University\BES2019_W27_v29.1.dta" // Fieldhouse, E., J. Green, G. Eva
> ns, J. Mellon, C. Prosser, J. Bailey, R. de Geus, H. Schmitt, C. van der Eijk, J. Griffiths, & S. Perrett. (2
> 024) British Election Study Internet Panel Waves 1-29. DOI: 10.5255/UKDA-SN-8202-2 // Accessed March 11 2025

. 
. // Social justice scale
. * Clean "don't know" responses
. foreach var in cwTrans cwAuthors cwLanguage cwTraining {
  2.     replace `var' = . if `var' == 9999
  3. }
(2,304 real changes made, 2,304 to missing)
(1,968 real changes made, 1,968 to missing)
(836 real changes made, 836 to missing)
(2,598 real changes made, 2,598 to missing)

. 
. *Reverse variable so social justice coded high
. foreach var in cwLanguage cwTraining {
  2.     qui sum `var'
  3.     local max_value = r(max)
  4.     gen r`var' = `max_value' + 1 - `var'
  5. }
(6,713 missing values generated)
(8,475 missing values generated)

. 
. *Standardize items in the scale from 1-2 - this avoids 0, for reasons outlined in next step
. foreach var in cwTrans cwAuthors rcwLanguage rcwTraining {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
     cwTrans |     22,264    1.836687    1.123953          1          5
(8,181 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   cwAuthors |     22,600    2.826416    1.120115          1          5
(7,845 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 rcwLanguage |     23,732    2.047109    1.102235          1          5
(6,713 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 rcwTraining |     21,970    2.904188      1.2857          1          5
(8,475 missing values generated)

. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values and means a 0-1 standardization scale isn't feasible as missing values would overlap with the scale
. foreach var in scwTrans scwAuthors srcwLanguage srcwTraining {
  2.     replace `var' = 0 if missing(`var')
  3. }
(8,181 real changes made)
(7,845 real changes made)
(6,713 real changes made)
(8,475 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scoreSJV = 0

. gen count_nonzeroSJV = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in scwTrans scwAuthors srcwLanguage srcwTraining {
  2.     replace total_scoreSJV = total_scoreSJV + `var'
  3.     replace count_nonzeroSJV = count_nonzeroSJV + (`var' != 0)
  4. }
(22,264 real changes made)
(22,264 real changes made)
(22,600 real changes made)
(22,600 real changes made)
(23,732 real changes made)
(23,732 real changes made)
(21,970 real changes made)
(21,970 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen socJusValues = .
(30,445 missing values generated)

. replace socJusValues = total_scoreSJV / count_nonzeroSJV if count_nonzeroSJV > 0
(24,215 real changes made)

. 
. // Liberalism scale reverse
. qui sum al_scale

. local max_value = r(max)

. gen reversed_al_scale = `max_value' - al_scale
(4,282 missing values generated)

. 
. // Measures of democracy
. * Clean don't know responses
. foreach var in strongLeader populism1 populism2 populism4 populism5 populism6 {
  2.     replace `var' = . if `var' == 9999
  3. }
(2,705 real changes made, 2,705 to missing)
(369 real changes made, 369 to missing)
(632 real changes made, 632 to missing)
(1,078 real changes made, 1,078 to missing)
(374 real changes made, 374 to missing)
(918 real changes made, 918 to missing)

. 
. *Standardize items in the scale from 1-2 - this avoids 0, for reasons outlined in next step. Include strongle
> ader question so this item has a 1-2 scale, same as other dependent variables in the book
. foreach var in strongLeader populism1 populism2 populism4 populism5 populism6 {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
strongLeader |     27,740     2.25894     1.26141          1          5
(2,705 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   populism1 |      7,146    4.030786    .8253529          1          5
(23,299 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   populism2 |      6,883    3.322824    1.059182          1          5
(23,562 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   populism4 |      6,437    3.313966    1.016678          1          5
(24,008 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   populism5 |      7,141    4.084442    .8099591          1          5
(23,304 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   populism6 |      6,597     3.29089     1.01406          1          5
(23,848 missing values generated)

. 
. *At this point, the populism scale has a Cronbach's alpha of 0.77
. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values and means a 0-1 standardization scale isn't feasible as missing values would overlap with the scale
. foreach var in spopulism1 spopulism2 spopulism4 spopulism5 spopulism6 {
  2.     replace `var' = 0 if missing(`var')
  3. }
(23,299 real changes made)
(23,562 real changes made)
(24,008 real changes made)
(23,304 real changes made)
(23,848 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scorePOP = 0

. gen count_nonzeroPOP = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in spopulism1 spopulism2 spopulism4 spopulism5 spopulism6 {
  2.     replace total_scorePOP = total_scorePOP + `var'
  3.     replace count_nonzeroPOP = count_nonzeroPOP + (`var' != 0)
  4. }
(7,146 real changes made)
(7,146 real changes made)
(6,883 real changes made)
(6,883 real changes made)
(6,437 real changes made)
(6,437 real changes made)
(7,141 real changes made)
(7,141 real changes made)
(6,597 real changes made)
(6,597 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen Populism = .
(30,445 missing values generated)

. replace Populism = total_scorePOP / count_nonzeroPOP if count_nonzeroPOP > 0
(7,320 real changes made)

. 
. rename sstrongLeader StrongLeader

. 
. // Demographics
. *Delete missing values and rename
. replace p_gross_household = . if inlist(p_gross_household, 16, 17) // missing about 25%
(7,927 real changes made, 7,927 to missing)

. rename gender FemaleGender

. 
. *Generate dummies
. gen MinorityEthnic=. 
(30,445 missing values generated)

. replace MinorityEthnic=0 if inlist(p_ethnicity, 1, 2)
(27,223 real changes made)

. replace MinorityEthnic=1 if inrange(p_ethnicity, 3, 15)
(2,835 real changes made)

. 
. gen Graduate=.
(30,445 missing values generated)

. replace Graduate=0 if inrange(p_edlevelUni, 0, 3)
(13,973 real changes made)

. replace Graduate=1 if inrange(p_edlevelUni, 4, 5)
(12,403 real changes made)

. 
. // Standardize
. egen Age = std(age)

. egen Income = std(p_gross_household)
(8,043 missing values generated)

. egen LibValues = std(reversed_al_scale)
(4,282 missing values generated)

. egen SocJusValues = std(socJusValues)
(6,230 missing values generated)

. 
. 
. // Regressions
. regress Populism SocJusValues [pweight=wt], robust 
(sum of wgt is 5,761.99435384122)

Linear regression                               Number of obs     =      5,850
                                                F(1, 5848)        =      74.59
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0194
                                                Root MSE          =     .17214

------------------------------------------------------------------------------
             |               Robust
    Populism | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
SocJusValues |  -.0238841   .0027655    -8.64   0.000    -.0293055   -.0184628
       _cons |   1.672544   .0028141   594.34   0.000     1.667027     1.67806
------------------------------------------------------------------------------

. eststo
(est1 stored)

. regress Populism SocJusValues Age FemaleGender Graduate Income MinorityEthnic [pweight=wt], robust 
(sum of wgt is 3,858.10171289408)

Linear regression                               Number of obs     =      3,887
                                                F(6, 3880)        =      33.63
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0720
                                                Root MSE          =     .16618

--------------------------------------------------------------------------------
               |               Robust
      Populism | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
  SocJusValues |  -.0291971    .003599    -8.11   0.000    -.0362532    -.022141
           Age |  -.0216018   .0035516    -6.08   0.000     -.028565   -.0146386
  FemaleGender |   .0313056   .0068731     4.55   0.000     .0178305    .0447808
      Graduate |  -.0449543   .0067802    -6.63   0.000    -.0582474   -.0316611
        Income |  -.0182925   .0036134    -5.06   0.000    -.0253767   -.0112082
MinorityEthnic |   .0202446   .0133721     1.51   0.130    -.0059723    .0464616
         _cons |   1.635848   .0120331   135.95   0.000     1.612256     1.65944
--------------------------------------------------------------------------------

. eststo
(est2 stored)

. regress StrongLeader SocJusValues Age FemaleGender Graduate Income MinorityEthnic [pweight=wt], robust 
(sum of wgt is 14,437.6671057039)

Linear regression                               Number of obs     =     14,550
                                                F(6, 14543)       =     181.97
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0873
                                                Root MSE          =     .30498

--------------------------------------------------------------------------------
               |               Robust
  StrongLeader | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
  SocJusValues |  -.0677959   .0031617   -21.44   0.000    -.0739932   -.0615987
           Age |  -.0094777   .0033053    -2.87   0.004    -.0159564    -.002999
  FemaleGender |    .035123   .0061056     5.75   0.000     .0231553    .0470907
      Graduate |  -.0996601   .0064102   -15.55   0.000    -.1122249   -.0870953
        Income |  -.0173622   .0032539    -5.34   0.000    -.0237402   -.0109842
MinorityEthnic |   .0637205   .0108822     5.86   0.000       .04239    .0850509
         _cons |   1.331127   .0103753   128.30   0.000      1.31079    1.351464
--------------------------------------------------------------------------------

. eststo
(est3 stored)

. regress Populism SocJusValues Age FemaleGender Graduate Income MinorityEthnic LibValues [pweight=wt], robust 
(sum of wgt is 3,420.9197614293)

Linear regression                               Number of obs     =      3,465
                                                F(7, 3457)        =      61.26
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1536
                                                Root MSE          =     .15959

--------------------------------------------------------------------------------
               |               Robust
      Populism | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
  SocJusValues |   .0002196   .0042203     0.05   0.958    -.0080548    .0084941
           Age |  -.0304837   .0036683    -8.31   0.000    -.0376761   -.0232914
  FemaleGender |   .0220798   .0073037     3.02   0.003     .0077597    .0363999
      Graduate |  -.0302702   .0071808    -4.22   0.000    -.0443493   -.0161912
        Income |  -.0152416   .0037856    -4.03   0.000    -.0226637   -.0078194
MinorityEthnic |    .006417   .0151385     0.42   0.672    -.0232643    .0360983
     LibValues |  -.0625747   .0041634   -15.03   0.000    -.0707376   -.0544117
         _cons |   1.639415   .0124836   131.33   0.000     1.614939    1.663891
--------------------------------------------------------------------------------

. eststo
(est4 stored)

. regress StrongLeader SocJusValues Age FemaleGender Graduate Income MinorityEthnic LibValues [pweight=wt], rob
> ust 
(sum of wgt is 12,910.5655238737)

Linear regression                               Number of obs     =     13,082
                                                F(7, 13074)       =     387.32
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1979
                                                Root MSE          =     .28795

--------------------------------------------------------------------------------
               |               Robust
  StrongLeader | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------+----------------------------------------------------------------
  SocJusValues |  -.0075939   .0037597    -2.02   0.043    -.0149635   -.0002243
           Age |   -.029333   .0033427    -8.78   0.000    -.0358852   -.0227807
  FemaleGender |   .0121318   .0061082     1.99   0.047     .0001588    .0241048
      Graduate |  -.0577353   .0066872    -8.63   0.000    -.0708432   -.0446275
        Income |   -.015561   .0032898    -4.73   0.000    -.0220093   -.0091126
MinorityEthnic |   .0438333   .0112087     3.91   0.000     .0218627    .0658039
     LibValues |  -.1293888   .0038741   -33.40   0.000    -.1369825   -.1217951
         _cons |   1.346646   .0102837   130.95   0.000     1.326489    1.366804
--------------------------------------------------------------------------------

. eststo
(est5 stored)

. esttab

--------------------------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)             (5)   
                 Populism        Populism    StrongLeader        Populism    StrongLeader   
--------------------------------------------------------------------------------------------
SocJusValues      -0.0239***      -0.0292***      -0.0678***     0.000220        -0.00759*  
                  (-8.64)         (-8.11)        (-21.44)          (0.05)         (-2.02)   

Age                               -0.0216***     -0.00948**       -0.0305***      -0.0293***
                                  (-6.08)         (-2.87)         (-8.31)         (-8.78)   

FemaleGender                       0.0313***       0.0351***       0.0221**        0.0121*  
                                   (4.55)          (5.75)          (3.02)          (1.99)   

Graduate                          -0.0450***      -0.0997***      -0.0303***      -0.0577***
                                  (-6.63)        (-15.55)         (-4.22)         (-8.63)   

Income                            -0.0183***      -0.0174***      -0.0152***      -0.0156***
                                  (-5.06)         (-5.34)         (-4.03)         (-4.73)   

MinorityEt~c                       0.0202          0.0637***      0.00642          0.0438***
                                   (1.51)          (5.86)          (0.42)          (3.91)   

LibValues                                                         -0.0626***       -0.129***
                                                                 (-15.03)        (-33.40)   

_cons               1.673***        1.636***        1.331***        1.639***        1.347***
                 (594.34)        (135.95)        (128.30)        (131.33)        (130.95)   
--------------------------------------------------------------------------------------------
N                    5850            3887           14550            3465           13082   
--------------------------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. log close
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix8.3.log
  log type:  text
 closed on:  12 May 2025, 18:16:04
---------------------------------------------------------------------------------------------------------------
